/**
 * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.vijayan.profile.model.impl;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.model.impl.BaseModelImpl;
import com.liferay.portal.service.ServiceContext;

import com.liferay.portlet.expando.model.ExpandoBridge;
import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;

import com.vijayan.profile.model.Horoscope;
import com.vijayan.profile.model.HoroscopeModel;
import com.vijayan.profile.model.HoroscopeSoap;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.ArrayList;
import java.util.List;

/**
 * The base model implementation for the Horoscope service. Represents a row in the &quot;kalyan_horoscope&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.vijayan.profile.model.HoroscopeModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link HoroscopeImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a horoscope model instance should use the {@link com.vijayan.profile.model.Horoscope} interface instead.
 * </p>
 *
 * @author vijayan
 * @see HoroscopeImpl
 * @see com.vijayan.profile.model.Horoscope
 * @see com.vijayan.profile.model.HoroscopeModel
 * @generated
 */
public class HoroscopeModelImpl extends BaseModelImpl<Horoscope>
	implements HoroscopeModel {
	public static final String TABLE_NAME = "kalyan_horoscope";
	public static final Object[][] TABLE_COLUMNS = {
			{ "horoscopeId", new Integer(Types.BIGINT) },
			{ "profileId", new Integer(Types.BIGINT) },
			{ "suryan", new Integer(Types.INTEGER) },
			{ "chandra", new Integer(Types.INTEGER) },
			{ "kuja", new Integer(Types.INTEGER) },
			{ "budha", new Integer(Types.INTEGER) },
			{ "guru", new Integer(Types.INTEGER) },
			{ "sukra", new Integer(Types.INTEGER) },
			{ "sani", new Integer(Types.INTEGER) },
			{ "rahu", new Integer(Types.INTEGER) },
			{ "ketu", new Integer(Types.INTEGER) },
			{ "mandhi", new Integer(Types.INTEGER) },
			{ "lagna", new Integer(Types.INTEGER) }
		};
	public static final String TABLE_SQL_CREATE = "create table kalyan_horoscope (horoscopeId LONG not null primary key,profileId LONG,suryan INTEGER,chandra INTEGER,kuja INTEGER,budha INTEGER,guru INTEGER,sukra INTEGER,sani INTEGER,rahu INTEGER,ketu INTEGER,mandhi INTEGER,lagna INTEGER)";
	public static final String TABLE_SQL_DROP = "drop table kalyan_horoscope";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.vijayan.profile.model.Horoscope"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.vijayan.profile.model.Horoscope"),
			true);

	/**
	 * Converts the soap model instance into a normal model instance.
	 *
	 * @param soapModel the soap model instance to convert
	 * @return the normal model instance
	 */
	public static Horoscope toModel(HoroscopeSoap soapModel) {
		Horoscope model = new HoroscopeImpl();

		model.setHoroscopeId(soapModel.getHoroscopeId());
		model.setProfileId(soapModel.getProfileId());
		model.setSuryan(soapModel.getSuryan());
		model.setChandra(soapModel.getChandra());
		model.setKuja(soapModel.getKuja());
		model.setBudha(soapModel.getBudha());
		model.setGuru(soapModel.getGuru());
		model.setSukra(soapModel.getSukra());
		model.setSani(soapModel.getSani());
		model.setRahu(soapModel.getRahu());
		model.setKetu(soapModel.getKetu());
		model.setMandhi(soapModel.getMandhi());
		model.setLagna(soapModel.getLagna());

		return model;
	}

	/**
	 * Converts the soap model instances into normal model instances.
	 *
	 * @param soapModels the soap model instances to convert
	 * @return the normal model instances
	 */
	public static List<Horoscope> toModels(HoroscopeSoap[] soapModels) {
		List<Horoscope> models = new ArrayList<Horoscope>(soapModels.length);

		for (HoroscopeSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}

	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.vijayan.profile.model.Horoscope"));

	public HoroscopeModelImpl() {
	}

	public long getPrimaryKey() {
		return _horoscopeId;
	}

	public void setPrimaryKey(long pk) {
		setHoroscopeId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_horoscopeId);
	}

	public long getHoroscopeId() {
		return _horoscopeId;
	}

	public void setHoroscopeId(long horoscopeId) {
		_horoscopeId = horoscopeId;
	}

	public long getProfileId() {
		return _profileId;
	}

	public void setProfileId(long profileId) {
		_profileId = profileId;
	}

	public int getSuryan() {
		return _suryan;
	}

	public void setSuryan(int suryan) {
		_suryan = suryan;
	}

	public int getChandra() {
		return _chandra;
	}

	public void setChandra(int chandra) {
		_chandra = chandra;
	}

	public int getKuja() {
		return _kuja;
	}

	public void setKuja(int kuja) {
		_kuja = kuja;
	}

	public int getBudha() {
		return _budha;
	}

	public void setBudha(int budha) {
		_budha = budha;
	}

	public int getGuru() {
		return _guru;
	}

	public void setGuru(int guru) {
		_guru = guru;
	}

	public int getSukra() {
		return _sukra;
	}

	public void setSukra(int sukra) {
		_sukra = sukra;
	}

	public int getSani() {
		return _sani;
	}

	public void setSani(int sani) {
		_sani = sani;
	}

	public int getRahu() {
		return _rahu;
	}

	public void setRahu(int rahu) {
		_rahu = rahu;
	}

	public int getKetu() {
		return _ketu;
	}

	public void setKetu(int ketu) {
		_ketu = ketu;
	}

	public int getMandhi() {
		return _mandhi;
	}

	public void setMandhi(int mandhi) {
		_mandhi = mandhi;
	}

	public int getLagna() {
		return _lagna;
	}

	public void setLagna(int lagna) {
		_lagna = lagna;
	}

	public Horoscope toEscapedModel() {
		if (isEscapedModel()) {
			return (Horoscope)this;
		}
		else {
			return (Horoscope)Proxy.newProxyInstance(Horoscope.class.getClassLoader(),
				new Class[] { Horoscope.class }, new AutoEscapeBeanHandler(this));
		}
	}

	public ExpandoBridge getExpandoBridge() {
		if (_expandoBridge == null) {
			_expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(0,
					Horoscope.class.getName(), getPrimaryKey());
		}

		return _expandoBridge;
	}

	public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
		getExpandoBridge().setAttributes(serviceContext);
	}

	public Object clone() {
		HoroscopeImpl clone = new HoroscopeImpl();

		clone.setHoroscopeId(getHoroscopeId());
		clone.setProfileId(getProfileId());
		clone.setSuryan(getSuryan());
		clone.setChandra(getChandra());
		clone.setKuja(getKuja());
		clone.setBudha(getBudha());
		clone.setGuru(getGuru());
		clone.setSukra(getSukra());
		clone.setSani(getSani());
		clone.setRahu(getRahu());
		clone.setKetu(getKetu());
		clone.setMandhi(getMandhi());
		clone.setLagna(getLagna());

		return clone;
	}

	public int compareTo(Horoscope horoscope) {
		long pk = horoscope.getPrimaryKey();

		if (getPrimaryKey() < pk) {
			return -1;
		}
		else if (getPrimaryKey() > pk) {
			return 1;
		}
		else {
			return 0;
		}
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		Horoscope horoscope = null;

		try {
			horoscope = (Horoscope)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long pk = horoscope.getPrimaryKey();

		if (getPrimaryKey() == pk) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return (int)getPrimaryKey();
	}

	public String toString() {
		StringBundler sb = new StringBundler(27);

		sb.append("{horoscopeId=");
		sb.append(getHoroscopeId());
		sb.append(", profileId=");
		sb.append(getProfileId());
		sb.append(", suryan=");
		sb.append(getSuryan());
		sb.append(", chandra=");
		sb.append(getChandra());
		sb.append(", kuja=");
		sb.append(getKuja());
		sb.append(", budha=");
		sb.append(getBudha());
		sb.append(", guru=");
		sb.append(getGuru());
		sb.append(", sukra=");
		sb.append(getSukra());
		sb.append(", sani=");
		sb.append(getSani());
		sb.append(", rahu=");
		sb.append(getRahu());
		sb.append(", ketu=");
		sb.append(getKetu());
		sb.append(", mandhi=");
		sb.append(getMandhi());
		sb.append(", lagna=");
		sb.append(getLagna());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(43);

		sb.append("<model><model-name>");
		sb.append("com.vijayan.profile.model.Horoscope");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>horoscopeId</column-name><column-value><![CDATA[");
		sb.append(getHoroscopeId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>profileId</column-name><column-value><![CDATA[");
		sb.append(getProfileId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>suryan</column-name><column-value><![CDATA[");
		sb.append(getSuryan());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>chandra</column-name><column-value><![CDATA[");
		sb.append(getChandra());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>kuja</column-name><column-value><![CDATA[");
		sb.append(getKuja());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>budha</column-name><column-value><![CDATA[");
		sb.append(getBudha());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>guru</column-name><column-value><![CDATA[");
		sb.append(getGuru());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>sukra</column-name><column-value><![CDATA[");
		sb.append(getSukra());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>sani</column-name><column-value><![CDATA[");
		sb.append(getSani());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>rahu</column-name><column-value><![CDATA[");
		sb.append(getRahu());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>ketu</column-name><column-value><![CDATA[");
		sb.append(getKetu());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>mandhi</column-name><column-value><![CDATA[");
		sb.append(getMandhi());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>lagna</column-name><column-value><![CDATA[");
		sb.append(getLagna());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private long _horoscopeId;
	private long _profileId;
	private int _suryan;
	private int _chandra;
	private int _kuja;
	private int _budha;
	private int _guru;
	private int _sukra;
	private int _sani;
	private int _rahu;
	private int _ketu;
	private int _mandhi;
	private int _lagna;
	private transient ExpandoBridge _expandoBridge;
}